<template>
	<div class="yz">
		<view class="icon-circle"><text class="cuIcon-scan" @click="onScan"></text></view>
		<view class="icon-circle"><text class="cuIcon-settings" @click="$pub.naviTo('/pages/other/Setting/index')"></text></view>
	</div>
</template>
<script>
export default {
	name: '',
	data() {
		return {};
	},
	methods:{
		onScan(){
			let  that = this
			// 允许从相机和相册扫码
			uni.scanCode({
			    success: function (res) {
			        console.log('条码类型：' + res.scanType);
			        console.log('条码内容：' + res.result);
					that.$pub.Toast('条码内容'+res.result)
			    },
				fail(err){
					that.$pub.Toast('您取消了扫码')
				}
			});
		}
	}
};
</script>
<style lang="less" scoped>
.yz {
	padding: 6px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	// background-color: #fff;
}
</style>
